﻿<!DOCTYPE html>
<html>
<!--隐患排查上报管理编辑 add-->

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta ScreeningStandard="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

</head>

<body>
    
<div id="app" v-cloak>   
        <el-form label-position="right" ref="form" :inline="true" :model="formInline" class="demo-form-inline"
            style="margin-bottom: 15px;">
            <el-row>
                <el-col class="head-tool">
                    <el-form-item>
                        <el-input v-model="formInline.model.ScreeningStandard"
                            :placeholder="RisksManagement.RiskReport.ScreeningStandard" size="mini">
                            <template slot="prepend">
                                {{RisksManagement.RiskReport.ScreeningStandard+mark.m}}
                            </template>
                        </el-input>
                    </el-form-item>
                    <el-button type="primary" @click="onSubmit" size="mini">{{col.btnSelect}}</el-button>
                    <el-button type="primary" @click="onSubmitForm" size="mini">{{col.Choose}}</el-button>
                </el-col>
            </el-row>

            <!-- <el-row>
                <el-col :xs="6" :sm="6" :md="6" :lg="4" :xl="4">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input v-model="formInline.model.ScreeningStandard"
                                :placeholder="RisksManagement.RiskReport.ScreeningStandard" size="mini">
                                <template slot="prepend">
                                    {{RisksManagement.RiskReport.ScreeningStandard+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row> -->
        </el-form>
        <el-col :span="4">
            <!-- <div class="tree_lay"> -->
                <!-- <h4 class="title clearfix"><strong>区域</strong></h4> -->
                <el-tree :data="TreeData" :props="defaultProps" @node-click="handleNodeClick">
                    <span slot-scope="scope">
                        <span>
                            <i :class="scope.data.icon"></i>
                            <template>
                                <span v-if="scope.data.icon == 'tree-open'"
                                    style="color:#12489e">{{ scope.node.label }}</span>
                                <span v-else-if="scope.data.icon == 'tree-close'"
                                    style="color: #12489e">{{ scope.node.label }}</span>
                                <span v-else>{{ scope.node.label }}</span>
                            </template>
                        </span>
                </el-tree>
            <!-- </div> -->
        </el-col>
        <el-col :span="20">
            <el-table ref="table" :data="ListItem.tableData" :row-key="getRowKeys" border
                @selection-change="handleSelectionChange" row-style="height:10px" style="width: 100%;">
                <el-table-column type="selection" style="
        padding-top: 0px;
        padding-bottom: 0px;
    " align="center" width="55" :reserve-selection="true">
                </el-table-column>
                <el-table-column prop="Project" :label="RisksManagement.RiskReport.Project">
                </el-table-column>
                <el-table-column prop="ScreeningStandard" :label="RisksManagement.RiskReport.ScreeningStandard">
                </el-table-column>

            </el-table>
            <el-row type="flex" justify="end">
                <el-pagination ref="page" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                    :current-page="ListItem.currentPage" :page-sizes="ListItem.pagesizes" :page-size="ListItem.pagesize"
                    :layout="ListItem.layout" :total="ListItem.total">
                </el-pagination>
            </el-row>
        </el-col>
        <br>
        <el-button class="fr" type="primary" @click="parent.ListItem.dialogVisible=false">{{col.btnBack}}</el-button>
    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                //页面内左树
                TreeData: [],
                mydata: myTree2,
                defaultProps: {
                    children: 'children',
                    label: 'label'
                },
                //表单内容
                ListItem: ListItem,
                //获取下拉菜单situation
                situation: [],
                TreeNode: [],
                formInline: {
                    model: { ScreeningStandard: '' },
                    ScreeningStandard: '',
                    offset: 0,
                    limit: 10,
                    TreeNode: ''

                }
            },
            mounted: function () {
                //获取下拉菜单内容
                this.situation = getDicData('54');
                //初始化数据
                this.GetPageData(1);
                //列表高度自适应
                tablehigh(this);
                this.TreeData = fn(this.mydata, "0");
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                handleNodeClick: function (data) {
                    //当前节点如果为最底层的才触发新的查询?暂时先这么处理,如果每层节点都查询就把判断去掉,并在接口逻辑模糊查询
                    if (!data.children) {
                        this.formInline.model.TreeNode = data.id
                        onSubmit(this);
                    }

                },
                //关闭Dialog 回调
                closeDialog: function () { closeDialog(this); },
                //列表选择触发
                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //获取分页数据
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/RiskReport/GetList') },
                //查询方法
                onSubmit: function () { onSubmit(this); },
                //pagesize改变 触发方法
                handleSizeChange: function (val) { handleSizeChange(this, val); },
                //跳页触发方法
                handleCurrentChange: function (val) { handleCurrentChange(this, val); },
                //获取下拉菜单数据
                getDropDown: function () {
                },
                onSubmitForm: function () {
                    var mythis = this;
                    if (mythis.ListItem.tableMultipleSelection.length != 1) {
                        showMessage(msg.OnlyOne, 'error')
                        return;
                    }
                    parent.app.Form.ScreeningStandard = "";
                    parent.app.Form.ScreeningStandard = this.ListItem.tableMultipleSelection[0].ScreeningStandard
                    parent.app.ListItem.dialogVisible = false;
                }
            }
        });
    </script>
</body>

</html>